﻿using System;
using System.Collections.Generic;
using System.Data;
using System.Data.Entity;
using System.Linq;
using System.Web;
using System.Web.Mvc;
using Guline.SupportCMS.Models.Object;
using Guline.SupportCMS.Models.Context;

namespace Guline.SupportCMS.Controllers
{
    public class HomeController : GulineBaseController
    {
        public HomeController()
        {
            this.TemplateID = 1;
        }

        public ActionResult Index()
        {
            int TemplateHook400ID = 23;
            int TemplateHook40ID = 24;
            int TemplateHook41ID = 7;
            int TemplateHook42ID = 8;
            int TemplateHook5ID = 5;

            var TemplateHook400 = db.TemplateHooks.Where(m => m.ID == TemplateHook400ID).FirstOrDefault();
            var TemplateHook40 = db.TemplateHooks.Where(m => m.ID == TemplateHook40ID).FirstOrDefault();
            var TemplateHook41 = db.TemplateHooks.Where(m => m.ID == TemplateHook41ID).FirstOrDefault();
            //TemplateHook41.Childrens = db.TemplateHooks.Where(m => m.ParentID == TemplateHook41ID&&m.Enable).OrderBy(m => m.Order).ToList();

            var TemplateHook42 = db.TemplateHooks.Where(m => m.ID == TemplateHook42ID).FirstOrDefault();
            //TemplateHook42.Childrens = db.TemplateHooks.Where(m => m.ParentID == TemplateHook42ID&&m.Enable).OrderBy(m => m.Order).ToList();

            var TemplateHook5 = db.TemplateHooks.Where(m => m.ID == TemplateHook5ID).FirstOrDefault();
            //TemplateHook5.Childrens = db.TemplateHooks.Where(m => m.ParentID == TemplateHook5ID && m.Enable).OrderBy(m => m.Order).ToList();
            ViewBag.TemplateHook400 = TemplateHook400;
            ViewBag.TemplateHook40 = TemplateHook40;
            ViewBag.TemplateHook41 = TemplateHook41;
            ViewBag.TemplateHook42 = TemplateHook42;
            ViewBag.TemplateHook5 = TemplateHook5;


            return View();
        }

    }
}
